namespace ExampleWebApplication.Entities
{
    public class CustomerCustomerDemo
    {
        public virtual string CustomerID { get; set; }

        public virtual string CustomerTypeID { get; set; }

        public virtual Customer Customer { get; set; }

        public virtual CustomerDemographic CustomerDemographic { get; set; }

        #region Equality members

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
            {
                return false;
            }

            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            if (obj.GetType() != typeof(CustomerCustomerDemo))
            {
                return false;
            }

            return Equals((CustomerCustomerDemo)obj);
        }

        public virtual bool Equals(CustomerCustomerDemo other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            return Equals(other.CustomerID, this.CustomerID) && Equals(other.CustomerTypeID, this.CustomerTypeID)
                   && Equals(other.Customer, this.Customer)
                   && Equals(other.CustomerDemographic, this.CustomerDemographic);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                int result = this.CustomerID != null ? this.CustomerID.GetHashCode() : 0;
                result = (result * 397) ^ (this.CustomerTypeID != null ? this.CustomerTypeID.GetHashCode() : 0);
                result = (result * 397) ^ (this.Customer != null ? this.Customer.GetHashCode() : 0);
                result = (result * 397)
                         ^ (this.CustomerDemographic != null ? this.CustomerDemographic.GetHashCode() : 0);
                return result;
            }
        }

        #endregion
    }
}
